home *** CD-ROM | disk | FTP | other *** search
- //=--------------------------------------------------------------------------=
- // FontColorCtl.H
- //=--------------------------------------------------------------------------=
- // Copyright 1995 Microsoft Corporation. All Rights Reserved.
- //
- // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
- // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
- // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
- // PARTICULAR PURPOSE.
- //=--------------------------------------------------------------------------=
- //
- // class declaration for the FontColor control.
- //
- #ifndef _FONTCOLORCONTROL_H_
-
- #include "IPServer.H"
- #include "CtrlObj.H"
- #include "FontColorInterfaces.H"
- #include "Dispids.H"
-
- #include <olectlid.h>
-
- typedef struct tagFONTCOLORCTLSTATE {
-
- OLE_COLOR ocForeColor;
-
- } FONTCOLORCTLSTATE;
-
- //=--------------------------------------------------------------------------=
- // CFontColorControl
- //=--------------------------------------------------------------------------=
- // our control.
- //
- class CFontColorControl : public COleControl, public IFontColor, public ISupportErrorInfo {
-
- public:
- // IUnknown methods
- //
- DECLARE_STANDARD_UNKNOWN();
-
- // IDispatch methods
- //
- STDMETHOD(GetTypeInfoCount)(UINT *pctinfo) {
- return CAutomationObject::GetTypeInfoCount(pctinfo);
- }
- STDMETHOD(GetTypeInfo)(UINT itinfo, LCID lcid, ITypeInfo **ppTypeInfoOut) {
- return CAutomationObject::GetTypeInfo(itinfo, lcid, ppTypeInfoOut);
- }
- STDMETHOD(GetIDsOfNames)(REFIID riid, OLECHAR **rgszNames, UINT cnames, LCID lcid, DISPID *rgdispid) {
- return CAutomationObject::GetIDsOfNames(riid, rgszNames, cnames, lcid, rgdispid);
- }
-
- // ISupportErrorInfo methods
- //
- DECLARE_STANDARD_SUPPORTERRORINFO();
-
- // IFontColor methods
- //
- // TODO: copy over the method declarations from FontColorInterfaces.H
- // don't forget to remove the PURE from them.
- //
- STDMETHOD(get_Font)(IFontDisp FAR* FAR* pFont);
- STDMETHOD(put_Font)(IFontDisp FAR* pFont);
- STDMETHOD(get_ForeColor)(OLE_COLOR FAR* pocForeColor);
- STDMETHOD(put_ForeColor)(OLE_COLOR ocForeColor);
- STDMETHOD_(void, AboutBox)(void);
-
- // OLE Control stuff follows:
- //
- CFontColorControl(IUnknown *pUnkOuter);
- virtual ~CFontColorControl();
-
- // static creation function. all controls must have one of these!
- //
- static IUnknown *Create(IUnknown *);
-
- // we have to implement this here for the benefit of font, picture and
- // OLE_COLOR properties.
- //
- STDMETHOD(Invoke)(DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *);
-
- private:
- // overridables that the control must implement.
- //
- STDMETHOD(LoadBinaryState)(IStream *pStream);
- STDMETHOD(SaveBinaryState)(IStream *pStream);
- STDMETHOD(LoadTextState)(IPropertyBag *pPropertyBag, IErrorLog *pErrorLog);
- STDMETHOD(SaveTextState)(IPropertyBag *pPropertyBag, BOOL fWriteDefault);
- STDMETHOD(OnDraw)(HDC hdcDraw, LPCRECTL prcBounds, LPCRECTL prcWBounds, HDC hicTargetDev);
- virtual LRESULT WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
- virtual BOOL RegisterClassData(void);
-
- virtual HRESULT InternalQueryInterface(REFIID, void **);
- virtual void BeforeCreateWindow(void);
-
- // private state information.
- //
- FONTCOLORCTLSTATE m_state;
- IFont *m_pFont;
- };
-
-
- // TODO: if you have an array of verbs, then add an extern here with the name
- // of it, so that you can include it in the DEFINE_CONTROLOBJECT.
- // ie. extern VERBINFO m_FontColorCustomVerbs [];
- //
- extern const GUID *rgFontColorPropPages [];
- DEFINE_CONTROLOBJECT(FontColor,
- &CLSID_FontColor,
- "FontColorCtl",
- CFontColorControl::Create,
- 1,
- &IID_IFontColor,
- "FontColor.HLP",
- &DIID_DFontColorEvents,
- OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|OLEMISC_RECOMPOSEONRESIZE|OLEMISC_CANTLINKINSIDE|OLEMISC_INSIDEOUT,
- RESID_TOOLBOX_BITMAP,
- "FontColorWndClass",
- 1,
- rgFontColorPropPages,
- 0,
- NULL);
-
-
-
- #define _FONTCOLORCONTROL_H_
- #endif // _FONTCOLORCONTROL_H_
-
-